Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some Prophecy usage #6416

Closed
wants to merge 1 commit into from

Conversation

franmomu
Copy link
Member

@franmomu franmomu commented Sep 25, 2020

Since sonata-project/dev-kit#1014, test on PHP 8 fail because a lot of warnings are thrown in PHPUnit 9, most of them coming because of the use of Prophecy.

Ref: sonata-project/dev-kit#624

From 693 warnings to 156.

We cannot require phpspec/prophecy-phpunit because it requires PHP 7.3.

Reduces the number of warnings using PHPUnit 9.
@@ -2959,10 +2973,24 @@ public function testCanonicalizedLocaleForMoment(?string $expected, string $orig

public function testIsGrantedAffirmative(): void
{
$this->securityChecker
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been moved where it is actually used and I changed a little because before:

$this->securityChecker->isGranted(['foo', 'bar'], null)->willReturn(false);	
$this->securityChecker->isGranted(Argument::type('string'), null)->willReturn(true);

The first line was wrong because the implementation calls isGranted always with just one $role.

@vv12131415
Copy link
Contributor

We cannot require phpspec/prophecy-phpunit because it requires PHP 7.3.

What about rising our requirements to 7.3? Since 7.2 is in security fix state. I think it's ok to do that.

Copy link
Member

@VincentLanglet VincentLanglet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice !

@VincentLanglet
Copy link
Member

What about rising our requirements to 7.3? Since 7.2 is in security fix state. I think it's ok to do that.

Anyway, we were considering trying to stop using it.

@franmomu franmomu mentioned this pull request Sep 27, 2020
@franmomu
Copy link
Member Author

Done in #6421

@franmomu franmomu closed this Sep 27, 2020
@franmomu franmomu deleted the remove_some_prophecy branch September 27, 2020 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants